﻿namespace GoodAdmin.System;

/// <summary>
/// 用户扩展服务
/// </summary>
public interface IExtraUserService
{
    /// <summary>
    /// 添加用户
    /// </summary>
    /// <param name="userInput"></param>
    /// <returns></returns>
    Task AddUser(UserAddInput userInput);

    /// <summary>
    /// 更新用户信息
    /// </summary>
    /// <param name="userInput"></param>
    /// <returns></returns>
    Task UpdateUser(UserUpdateInput userInput);

    /// <summary>
    /// 删除用户
    /// </summary>
    /// <param name="input">用户Id列表</param>
    /// <returns></returns>
    Task DeleteUser(List<BaseIdInput> input);

    /// <summary>
    /// 改变用户状态
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<bool> ChangeStatus(BaseIdInput input);

    /// <summary>
    /// 用户分页查询
    /// </summary>
    /// <param name="input">查询参数</param>
    /// <returns>用户分页列表</returns>
    Task<SqlSugarPagedList<SysUser>> Page(UserPageInput input);

    /// <summary>
    /// 人员选择器
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<List<UserSelectorOutput>> GetUserSelector(UserSelectorInput input);

    /// <summary>
    /// 根据Id重置用户密码
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task ResetPassword(BaseIdInput input);

    /// <summary>
    /// 修改密码
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task ChangePassword(ChangePwdInput input);

    /// <summary>
    /// 用户授权角色
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task GrantUserRole(UserRoleInput input);

    /// <summary>
    /// 批量导入模板下载
    /// </summary>
    /// <returns></returns>
    FileStreamResult TemplateDownload();

    /// <summary>
    /// 批量添加用户
    /// </summary>
    /// <param name="file"></param>
    /// <returns></returns>
    Task<ExcelImportResult> BatchAddUser(IFormFile file);

    /// <summary>
    /// 下载错误记录
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    Task<FileStreamResult> ErrorDownload(BaseIdInput input);
}
